//
// Decompiled by Jadx - 392ms
//
package fq;

import fn.j;
import fn.x;
import fn.y;
import fo.c;
import java.util.Iterator;
import java.util.List;
import o.a;
import org.luckypray.dexkit.query.matchers.AnnotationMatcher;
import org.luckypray.dexkit.query.matchers.ClassMatcher;
import org.luckypray.dexkit.query.matchers.FieldMatcher;
import org.luckypray.dexkit.query.matchers.MethodMatcher;
import org.luckypray.dexkit.result.ClassData;
import org.luckypray.dexkit.result.ClassDataList;
import org.luckypray.dexkit.result.MethodData;
import org.luckypray.dexkit.result.MethodDataList;

@a("DYJS")
public final class q extends x {
    public static String cp;
    public static String cq;
    public static String cr;
    public static String cs;
    public static String ct;
    public ClassData cu;
    public ClassDataList cv;
    public MethodDataList cw;
    public boolean cx;
    public MethodData cy;

    public final void a() {
        MethodData methodData;
        ClassDataList v;
        Iterator it = c.t(MethodMatcher.create().usingEqStrings(new String[]{"homepage_hot_container", "homepage_hot_container"}).returnType(String.class).paramCount(0).modifiers(16).addInvoke(MethodMatcher.create().name("contains"))).getInvokes().iterator();
        while (true) {
            if (it.hasNext()) {
                methodData = (MethodData) it.next();
                if (methodData.getReturnTypeName().equals(List.class.getName())) {
                    break;
                }
            } else {
                methodData = null;
                break;
            }
        }
        if (methodData == null) {
            j.bi(new Object[]{"自适配顶部标签失败"});
            return;
        }
        this.cy = c.r(MethodMatcher.create().addCaller(MethodMatcher.create().declaredClass("com.ss.android.ugc.aweme.homepage.tab.HomeTabServiceImpl").usingEqStrings(new String[]{"homepage_hot_container", "homepage_bottom"})).paramCount(0).returnType(List.class));
        ClassMatcher addInterface = ClassMatcher.create().addInterface(methodData.getClassName());
        synchronized (c.class) {
            v = c.v(y.by.getBridge(), addInterface);
        }
        this.cv = v;
        this.cu = (ClassData) v.first();
        MethodData t = c.t(MethodMatcher.create().name("toString").usingStrings(new String[]{"(isUsable=", ", tabType="}));
        if (t.getDeclaredClass() != null) {
            cr = c.p(FieldMatcher.create().declaredClass(t.getDeclaredClass().getName()).addAnnotation(AnnotationMatcher.create().usingStrings(new String[]{"tab_id"}))).getFieldName();
            cs = c.p(FieldMatcher.create().declaredClass(t.getDeclaredClass().getName()).addAnnotation(AnnotationMatcher.create().usingStrings(new String[]{"tab_title"}))).getFieldName();
            ct = c.p(FieldMatcher.create().declaredClass(t.getDeclaredClass().getName()).addAnnotation(AnnotationMatcher.create().usingStrings(new String[]{"tab_type"}))).getFieldName();
        }
        if (this.cu != null) {
            MethodDataList z = c.z(MethodMatcher.create().declaredClass(this.cu.getName()).returnType(List.class));
            this.cw = z;
            if (z.size() > 1) {
                cp = ((MethodData) this.cw.get(0)).getMethodName();
                cq = ((MethodData) this.cw.get(1)).getMethodName();
                a aVar = new a(this);
                b bVar = new b();
                Iterator it2 = this.cv.iterator();
                while (it2.hasNext()) {
                    ClassData classData = (ClassData) it2.next();
                    j.bd(classData.getName(), cq, new Object[]{aVar});
                    j.bd(classData.getName(), this.cy.getMethodName(), new Object[]{bVar});
                }
            }
        }
        y.by.getDy().setDisLikeAweme(c.t(MethodMatcher.create().paramTypes(new String[]{"com.ss.android.ugc.aweme.feed.model.Aweme", "java.util.Map", "java.lang.String", "java.lang.String", "boolean", "com.ss.android.ugc.aweme.dislike.HandleVideoMethod", "int", "java.lang.Object"})));
    }
}
